﻿@using PagedList.Mvc;
@{
    PagedList.IPagedList<Model.Origins.OriginsTempletModel> myPageList = (PagedList.IPagedList<Model.Origins.OriginsTempletModel>)ViewBag.MyPageList;
    Layout = "~/Views/Shared/MyLayOutNew.cshtml";
}
<link href="~/Content/PagedList.css" rel="stylesheet" />
<main class="main-cont content mCustomScrollbar">
    <div class="page-wrap">
        <!--开始::内容-->
        <section class="page-hd">
            <header>
                <h2 class="title">溯源管理>>静态溯源</h2>
                <p class="title-description">
                    <button class="btn btn-primary" onclick="Edit('add');">基础按钮</button>
                </p>
            </header>
            <hr>
        </section>
        <table class="table mb-15">
            <thead>
                <tr>
                    <th><input type="checkbox" /></th>
                    <th>名称</th>
                    <th>创建日期</th>
                    <th>创建用户</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>

                @foreach (var item in myPageList)
{
    <tr class="cen">
        <td><input type="checkbox" /></td>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CreateDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CreateLoginName)
        </td>
        <td>
            <a title="编辑" class="mr-5" onclick="Edit(@item.ID)">编辑</a>
            <a title="详情" class="mr-5">详情</a>
            <a title="删除">删除</a>
        </td>
    </tr>
}    

            </tbody>
        </table>
        每页 @myPageList.PageSize 条记录，共 @myPageList.PageCount 页，当前第 @myPageList.PageNumber 页
        @Html.PagedListPager(myPageList, page => Url.Action("Index", new { page }))
        <!--开始::结束-->
    </div>
</main>
<script type="text/javascript">
    function Edit(obj) {
        //window.location.href = '/Jtsy/EditPhone';
        window.location.href = "/Jtsy/EditPhone?oper=edit&tempId=" + obj;
    }

</script>